package com.oocl.crm.service.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.command.impl.AddCommand;
import com.oocl.crm.exception.ParameterErrorException;
import com.oocl.crm.pojo.User;
import com.oocl.crm.service.BusinessService;

/**
 * A指令-业务处理-新增用户
 * @author GANAB
 *
 */
public class AddBusinessService extends BusinessService{
	
	public String service(Command command) throws ParameterErrorException {
		AddCommand addCommand = (AddCommand)command;//强转

		User user = addCommand.createUser();
		if(user!=null){
			this.getUserDB().add(user);
			return "Add user success! User data is "+user.toString();
		}
		return null;
	}
}
